export default {
  mounted() {},
  methods: {
    handlePreview(row) {
      if (!row) return
      let type = row.courseType
      let name = 'course-detail'
      if (type == 1) {
        name = 'course-detail'
      }
      if (type == 2) {
        name = 'specialty-detail'
      }
      if (type == 3) {
        name = 'arms-list-home'
      }
      if (type == 4) {
        name = 'topic-detail'
      }
      if (type == 5) {
        name = 'micro-detail'
      }
      if (type == 6) {
        name = 'training-detail'
      }
      this.$store.commit('SETCURCOURSE', row)
      if (type == 3) {
        const news = this.$router.resolve({
          name,
          query: { type: 3, queryMode: 2, courseId: row.id },
        })
        window.open(news.href, '_blank')
      } else {
        const news = this.$router.resolve({
          name,
          query: { courseId: row.id, queryMode: 2 },
        })
        window.open(news.href, '_blank')
      }
    },
  },
}
